
import cv2
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *

def show_graphics(self, imgs):
    img = cv2.cvtColor(imgs, cv2.COLOR_BGR2RGB)#matplotlib显示opencv的图像需要转换RGB通道，opencv读取图片为BGR
    x = img.shape[1]
    y = img.shape[0]
    frame = QImage(img, x, y, x * 3, QImage.Format_RGB888)
    pxi = QPixmap.fromImage(frame)
    self.item = QGraphicsPixmapItem(pxi)
    self.sence = QGraphicsScene()
    self.sence.addItem(self.item)
    self.graphicsView.setScene(self.sence)


